from datetime import datetime, date
import requests
import json
from app import db
from passlib.apps import custom_app_context as pwd_context
from itsdangerous import (TimedJSONWebSignatureSerializer
                          as Serializer, BadSignature, SignatureExpired)

class Old(db.Model):
    """老人"""
    __tablename__ = 'oldperson_info'
    __table_args__ = {'mysql_engine': 'InnoDB'}  # 支持事务操作和外键
    ID = db.Column(db.Integer, doc='ID', primary_key=True)
    username = db.Column(db.String(20), doc='username', default='Wanted User', nullable=False, unique=True)
    gender = db.Column(db.String(5), doc='gender', nullable=False)
    checkin_date = db.Column(db.DateTime,doc='checkin_date',nullable=False)
    room_number = db.Column(db.String(50), doc='room_number', nullable=False)
    age = db.Column(db.String(5), doc='age', nullable=False)
    phone = db.Column(db.String(50), doc='phone', nullable=False)
    REMOVE = db.Column(db.String(1), doc='REMOVE', nullable=False)
    DESCRIPTION = db.Column(db.String(50), doc='DESCRIPTION', default='这个人很懒，什么也没留下', nullable=False)
    health_state = db.Column(db.String(50),doc='health_state',default='良好',nullable=False)